/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package mscs.server.globalManager.logic;

import java.util.ArrayList;
import java.util.List;
import mscs.data.IFileDataStore;
import mscs.data.IGoodsProxy;
import mscs.data.pojo.Goods;

/**
 *
 * @author Administrator
 */
public class SearchGoodsInfoUtil implements ISearchGoodsInfoUtil{
    private IFileDataStore fds ;
    private List<Goods> searchList = new ArrayList<Goods> ();
    public SearchGoodsInfoUtil(){
        fds = new IGoodsProxy();
    }
    public List<Goods> getAll() {
        searchList = fds.searchObjectsByAttr("desc",".*");
        return searchList;
    }

    public List<Goods> searchByID(String id) {
        searchList =fds.getObjectsByAttr("id", id);
        return searchList;
    }

    public List<Goods> searchByDes(String desc) {
        searchList = fds.searchObjectsByAttr("desc", ".*"+desc+".*");
        return searchList;
    }
    
}
